#!/bin/sh
DEPENDS="libdbus-1-dev libxml2-dev php5-dev"
echo Required package: $DEPENDS
for depend in $DEPENDS
do
    echo -n checking required package: $depend ...
    dpkg -s $depend > /dev/null
    if [ $? -ne 0 ]; then
        echo It requires package "$depend". Please install "$depend" first.
        exit 1
    fi
    echo " [OK]."
done

phpize
./configure
make clean
make

if [ ! -x modules/dbus.so ]; then
    echo Failed to make dbus.so.
    exit 1
fi
cd ..

